package GiaoHangVietNam.RawInfor;

import android.content.Context;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.telephony.TelephonyManager;

import com.google.android.gms.maps.model.LatLng;

public class ClientControlMessage {
	public static LatLng CurrentGeo= new LatLng(0, 0);
	public static int ShipperID;
	public static short RegionID;
	public static Boolean Inited=false;
	public static LatLng StartGeo;
	
	public static int OtherShipperID;
	public static short OtherRegionID;
	
	public static String IMEI;
	
	public static void Inits(int shipperID, short regionID,String imei)
	{
		ShipperID=shipperID;
		RegionID=regionID;
		Inited=true;
		StartGeo=  new LatLng(CurrentGeo.latitude, CurrentGeo.longitude);
		IMEI=imei; 
	}
	 
	
	public static void UpdateInterChange(int otherShipperID, short otherRegionID)
	{
		OtherShipperID = otherShipperID;
		OtherRegionID=otherRegionID;
	}
	   
	// Bản tin đăng nhập
	public static String Login()
	{
		return  "@"+MessageTypeID.LOGIN+"#"+ShipperID+"#"+IMEI+"#"+StartGeo.latitude+"#"+StartGeo.longitude;
	}
	// Bản tin định kỳ
	public static String CycleGPS()
	{
		return  "@"+MessageTypeID.CYCLE+"#"+ShipperID+"#"+CurrentGeo.latitude+"#"+CurrentGeo.longitude;
	}
	// Bản tin hoàn thành đơn hàng
	public static String FinishInvoice()
	{ 
		return  "@"+MessageTypeID.EVENT+"#" +ShipperID+"#"+CurrentGeo.latitude+"#"+CurrentGeo.longitude+"#"+EventCode.FINISH_INVOICE;
	}
	// Bản tin Hủy đơn hàng
	public static String CancelInvoice()
	{
		return  "@"+MessageTypeID.EVENT+"#"+ShipperID+"#"+ CurrentGeo.latitude+"#"+CurrentGeo.longitude+"#"+EventCode.CANCEL_INVOICE;
	}
	 
	// Chuyển giao đơn hàng cho vùng khác
	public static String FinishInterChangeInvoice()
	{
		return  "@"+MessageTypeID.INTERCHANGE_INVOICE+"#"+ShipperID+"#"+ CurrentGeo.latitude+"#"+CurrentGeo.longitude+"#"+EventCode.FINISH_INTERCHANGE+"#" +OtherShipperID + "#" + OtherRegionID;
	}
	public static String CancelInterChangeInvoice()
	{
		return  "@"+MessageTypeID.INTERCHANGE_INVOICE+"#"+ShipperID+"#"+ CurrentGeo.latitude+"#"+CurrentGeo.longitude+"#"+EventCode.CANCEL_INTERCHANGE+"#" +OtherShipperID + "#" + OtherRegionID;
	 
	}

}
